package guo.file;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class FileTest1 {
	public static void main(String[] args) {
		File file=new File("g:\\example.txt");
		String a;
		try (FileReader is=new FileReader(file)){
			
		
			char[] buffer=new char[1024];
			while(is.read(buffer)!=-1) {
				for(int i=0,len=buffer.length;i<len;i++) {
					System.out.print((char)buffer[i]);
				}
			}
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
